import { PureComponent } from 'react'
import SingleTable from 'components/table/index'
import { Divider, Input, Select, Button } from 'antd'
import BoardCardModal from 'components/modal/boardCardManageModal'
import styles from './boardingCardManage.less'
const { Option } = Select
export default class BoardingCardManage extends PureComponent {
    state = {
        visible: false
    }
    renderModal(){
        const { visible } = this.state
        return(
            <BoardCardModal
                visible={visible}
                onOk={this.handleOk}
                onCancel={this.handleCancel}
            />
        )
    }
    handleAdd = () => {
        this.setState({ visible: true})
    }
    handleOk = () => {
        this.setState({ visible: false})
    }
    handleCancel = () => {
        this.setState({ visible: false})
    }
    render(){
        const dataList = []
        const columns = [
        {
            key: 'gmtCreate',
            title: '舱单号',
            dataIndex: 'gmtCreate',
            align: 'center',
        },
        {
            key: 'operationTypeName',
            title: '舱单状态',
            dataIndex: 'operationTypeName',
            align: 'center',
        },
        {
            key: 'creatorName',
            title: '创建时间',
            dataIndex: 'creatorName',
            align: 'center',
        },
        {
            key: '4',
            title: '包件数',
            dataIndex: 'creatorName',
            align: 'center',
        },
        {
            key: '5',
            title: '包总称重(KG)',
            dataIndex: 'creatorName',
            align: 'center',
        },
        {
            key: '6',
            title: '供应商称重(KG)',
            dataIndex: 'creatorName',
            align: 'center',
        },
        {
            key: '7',
            title: '操作',
            dataIndex: 'creatorName',
            align: 'center',
            render: (text, record) => (
                <span>
                  <a >编辑</a>
                  <Divider type="vertical" />
                  <a>删除</a>
                </span>
            ),
        },
        ]
        return(
            <div className={styles.boardingCardManage}>
                <div className={styles.boardingCardManageBox}>
                    <h2>舱单管理</h2>
                </div>
                <div className={styles.boardingCardManageSearch}>
                    <div className={styles.boardingCardManageSin}>
                        <span className={styles.boardingCardManageSpan}>舱单号：</span>
                        <Input  className={styles.boardingCardManageInput}/>
                    </div>
                    <div className={styles.boardingCardManageSin} style={{marginLeft: '48px'}}>
                        <span className={styles.boardingCardManageSpan}>舱单状态：</span>
                        <Select defaultValue="lucy" className={styles.boardingCardManageInput}>
                            <Option value="jack">Jack</Option>
                            <Option value="lucy">Lucy</Option>
                            <Option value="Yiminghe">yiminghe</Option>
                        </Select>
                    </div>
                </div>
                <div className={styles.boardingCardManageButton}>
                    <Button type="primary" icon="search" style={{marginBottom: '24px'}}>查询</Button>
                    <Button icon="plus" style={{margin: '0 24px'}} onClick={this.handleAdd}>新建</Button>
                    <Button icon="plus" onClick={this.handleAdd}>新建拖包舱单</Button>
                    <Button icon="import" style={{margin: '0 24px'}}>箱单发票</Button>
                    <Button icon="import">Mainfest导出</Button>
                    <Button icon="import" style={{margin: '0 24px'}}>包裹号导出</Button>
                    <Button icon="import" style={{marginRight: '24px'}}>三免清单导出</Button>
                    <Button icon="import" style={{marginRight: '24px'}}>委托书导出</Button>
                    <Button icon="import">CN35导出</Button>
                    <Button icon="import" style={{marginLeft: '24px'}}>CN38导出</Button>
                </div>
                <div className={styles.boardingCardManageTable}>
                    <SingleTable
                        data={{ list: dataList }}
                        columns={columns}
                    />
                </div>
                {this.renderModal()}
            </div>
        )
    }
}